package com.fg.cloud.manager.mapper.agency;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fg.cloud.manager.entry.agency.AgencyAddressEntity;
import com.fg.cloud.manager.entry.agency.vo.AgencyAddressVo;
import com.fg.cloud.manager.mapper.BaseMapper;

/**
 * 经销商-区域
 * @author around
 * @date 2017-6-22
 */
public interface AgencyAddressMapper extends BaseMapper {

	long delByfacId(@Param("facId")Long facId);
	
    int deleteByPrimaryKey(Long id);

    AgencyAddressEntity selectByPrimaryKey(Long id);
    
    AgencyAddressEntity findOne(@Param("id")Long id, @Param("ageId")Long ageId);
    
    AgencyAddressEntity selectBycondition(AgencyAddressEntity searchVo);
    
    List<AgencyAddressEntity> selectAll(Long ageId);
    
    long finds(@Param("id")Long id, @Param("ageId")Long ageId);
    
    AgencyAddressEntity selectDefault(@Param("ageId")Long ageId);
     
    /**
     * Description:标准修改经销商地址内容
     * @param userId 用户ID
     * @param facId 厂商ID
     * @param ids
     * @param status 状态
     * @return long
     * @author around
     * @date 2017年8月9日上午11:30:02
     */
    long updateStatus(@Param ("userId")Long userId,@Param("ageId") Long ageId, 
    		@Param ("ids")Long[] ids, @Param ("status")Integer status);
    
    long remove(@Param("ageId") Long ageId, @Param ("ids")Long[] ids);
    
    long updateIsdefault(@Param ("userId")Long userId,@Param("ageId") Long ageId, 
    		@Param ("ids")Long[] ids, @Param ("isDefault")Integer isDefault);
    
    long setdefault(@Param ("userId")Long userId,@Param("ageId") Long ageId, 
    		@Param ("id")Long id, @Param ("isDefault")Integer isDefault);
    
    /**
     * Description:重置默认收货地址
     * @param ageId
     * @return
     * @author around
     * @date 2017年8月25日上午9:51:26
     */
    long resetDefault(@Param("ageId") Long ageId);
    
    /**
     * Description:校验
     * @param address
     * @return
     * @author around
     * @date 2017年8月27日下午5:03:24
     */
    long verifyUniquely(AgencyAddressVo address);
    
    long judgeIsExit(AgencyAddressVo address);
    
    long JudgeIsExit(AgencyAddressVo address);
    
    
    
}